import Vue from 'vue'
import App from './App.vue'

import "./style/reset.less"
import router from './router/index'

Vue.config.productionTip = false

import { GridItem, Grid, Search, SwipeCell, ActionSheet, List, PullRefresh, Button, Form, Toast, Field, Cell, CellGroup, NavBar, Icon, Uploader, Dialog, Tab, Tabs, Tabbar, TabbarItem } from 'vant';
Vue.use(Button);
Vue.use(Toast);
Vue.use(Form);
Vue.use(Field);
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(NavBar);
Vue.use(Icon);
Vue.use(Uploader);
Vue.use(Dialog);
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(Tabbar);
Vue.use(TabbarItem);
Vue.use(PullRefresh);
Vue.use(List)
Vue.use(ActionSheet);
Vue.use(SwipeCell);
Vue.use(Search);
Vue.use(Grid);
Vue.use(GridItem);


//注册全局组件
import newsItem from './views/newsItem.vue'
Vue.component('newsItem', newsItem)
import comment from './components/comment.vue'
Vue.component('comment', comment)

import axios from "./utils/request"
Vue.filter('joinPath', (val) => {
    if (val && val.indexOf('http') === -1) {
        return axios.defaults.baseURL + val
    } else {
        return val
    }
})

new Vue({
    router,
    render: h => h(App),
}).$mount('#app')
